home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_HDF.idb / usr / freeware / include / hdf / hdf.h.z / hdf.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  4.8 KB  |  172 lines

  1.  
  2. /****************************************************************************
  3.  * NCSA HDF                                                                 *
  4.  * Software Development Group                                               *
  5.  * National Center for Supercomputing Applications                          *
  6.  * University of Illinois at Urbana-Champaign                               *
  7.  * 605 E. Springfield, Champaign IL 61820                                   *
  8.  *                                                                          *
  9.  * For conditions of distribution and use, see the accompanying             *
  10.  * hdf/COPYING file.                                                        *
  11.  *                                                                          *
  12.  ****************************************************************************/
  13.  
  14. /* $Id: hdf.h,v 1.59 1998/02/20 19:25:10 koziol Exp $ */
  15.  
  16. #ifndef HDF_H
  17. #define HDF_H
  18.  
  19. #include "hdfi.h"
  20. #include "hlimits.h"
  21.  
  22. /* Internal DF structure */
  23. typedef struct
  24.   {
  25.       uint16      tag;          /* tag of element */
  26.       uint16      ref;          /* ref of element */
  27.   }
  28. DFdi;
  29.  
  30. /* For annotations */
  31. /* enumerated types of the varous annotation types */
  32. typedef enum 
  33.     AN_UNDEF = -1,
  34.     AN_DATA_LABEL = 0, /* Data label */
  35.     AN_DATA_DESC,      /* Data description */
  36.     AN_FILE_LABEL,     /* File label */
  37.     AN_FILE_DESC       /* File description */
  38. } ann_type;
  39.  
  40. /* internal file access codes */
  41.  
  42. #define DFACC_READ 1
  43. #define DFACC_WRITE 2
  44. #define DFACC_CREATE 4
  45. #define DFACC_ALL 7
  46.  
  47. #define DFACC_RDONLY 1
  48. #define DFACC_RDWR 3
  49. #define DFACC_CLOBBER 4
  50.  
  51. /* New file access codes (for Hstartaccess only, currently) */
  52. #define DFACC_BUFFER 8  /* buffer the access to this AID */
  53. #define DFACC_APPENDABLE 0x10 /* make this AID appendable */
  54. #define DFACC_CURRENT 0x20 /* start looking for a tag/ref from the current */
  55.                /* location in the DD list (useful for continued */
  56.                /* searching ala findfirst/findnext) */
  57.  
  58. /* External Element File access mode */
  59. /* #define DFACC_CREATE 4    is for creating new external element file */
  60. #define DFACC_OLD    1    /* for accessing existing ext. element file */
  61.  
  62. /* The magic cookie for Hcache to cache all files */
  63. #define CACHE_ALL_FILES (-2)
  64.  
  65. /* File access modes */
  66. /* 001--007 for different serial modes */
  67. /* 011--017 for different parallel modes */
  68.  
  69. #define DFACC_DEFAULT   000
  70. #define DFACC_SERIAL    001
  71. #define DFACC_PARALLEL  011
  72.  
  73. /* used by Hnextread to determine where to start searching for the
  74.    next tag/ref to read */
  75.  
  76. #define DF_START 0
  77. #define DF_CURRENT 1
  78. #define DF_END 2
  79.  
  80. /* Used by Hfind to determine the direction to search for tag/ref's in the */
  81. /* file. */
  82.  
  83. #define DF_FORWARD  1
  84. #define DF_BACKWARD 2
  85.  
  86. /* return code - since some unix/c routines use 0 and -1 as their return
  87.    code, and some assumption had been made in the code about that, it is
  88.    important to keep these constants the same values.  For explicitly
  89.    boolean functions, use TRUE and FALSE */
  90.  
  91. #define SUCCEED 0
  92. #define FAIL (-1)
  93.  
  94. /* boolean values,  reminder: NEVER compare with numeric values */
  95.  
  96. #ifndef FALSE
  97. #   define FALSE 0
  98. #endif
  99. #ifndef TRUE
  100. #   define TRUE (!FALSE)
  101. #endif
  102.  
  103. #ifndef NULL
  104. #   define NULL (void *)0
  105. #endif
  106.  
  107. /* macros */
  108. #define STREQ(s, t) (HDstrcmp((s), (t)) == 0)
  109. #define NSTREQ(s, t, n) (HDstrncmp((s), (t), (n)) == 0)
  110.  
  111. /*
  112.  * Macros used for variable and function scoping in code.....
  113.  */
  114. #ifndef EXPORT
  115. #define EXPORT
  116. #endif
  117.  
  118. #ifndef PRIVATE
  119. #define PRIVATE static
  120. #endif
  121.  
  122. /* Include the Number-type definitions */
  123. #include "hntdefs.h"
  124.  
  125. /* Include the Tag definitions */
  126. #include "htags.h"
  127.  
  128. /*
  129.    * interlacing supported by the vset.
  130.  */
  131.  
  132. #define FULL_INTERLACE  0
  133. #define NO_INTERLACE    1
  134.  
  135. /* type for File ID to send to Hlevel from Vxx interface */
  136. typedef int32 HFILEID;
  137.  
  138. typedef intn (*hdf_termfunc_t)(void);   /* termination function typedef */
  139.  
  140. /* .................................................................. */
  141.  
  142. /* Publically accessible functions declarations.  This includes all the
  143.    functions that are used by application programs.  */
  144.  
  145. #include "hbitio.h"
  146. #include "hcomp.h"
  147. #include "herr.h"
  148. #include "hproto.h"
  149. #include "vg.h"         /* Add the Vgroup/Vdata header so the users don't have to */
  150. #include "mfgr.h"       /* Add the GR header so the users don't have to */
  151.  
  152. /* For Pablo Instrumentation */
  153. #ifdef HAVE_PABLO
  154. #include "ProcIDs.h"
  155. #endif /* PABLO */
  156.  
  157. /* these may eventaully evolve into real-life functions but not yet */
  158. #define HDFopen(f,a,d)      Hopen((f), (a), (d))
  159. #define HDFclose(f,a,d)     Hclose((f), (a), (d))
  160. #define Vstart(f)           Vinitialize((f))
  161. #define Vend(f)             Vfinish((f))
  162.  
  163. /* Misc. macros for backward compability */
  164. #define HDgettagname(tag)   HDgettagdesc(tag)
  165.  
  166. /* This is also defined in fmpio.h */
  167. #define MP_PAGEALL    0x01  /* page the whole file i.e. no limit on 'maxcache'*/
  168.  
  169. #endif /* HDF_H */
  170.  
  171.